﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/AdminMaster.Master" AutoEventWireup="true"
    CodeBehind="ExpertList.aspx.cs" Inherits="ExpertMIS.Admin.ExpertList" %>

<%@ Register Src="UserControl/PagingGridView.ascx" TagName="PagingGridView" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style1
        {
            width: 60px;
        }
    </style>

    <script type="text/javascript" src="../js/jquery-1.3.2.js"></script>
    <script type="text/javascript">
        $(document).ready(function() {
             function setSearch(){
                // 判断用户姓名查询条件是否非空
                var userName = $("#<%=txName.ClientID %>").val();
                var selectValue = $("#<%=ddlDomain.ClientID %>").val();
                var search = " 1=1 ";
                if (userName && userName != "") {
                    search = search + " AND F_Name like '%" + userName + "%'";
                }
                if (selectValue != 'all') {
                    search = search + " AND F_OID in ( SELECT F_ExpertOID FROM T_EXP_ExpertBelongDomain WHERE F_DomainOID = '" + selectValue + "')"
                }
                
                // 保存查询条件
                $("#search").val(search);
                    
                return search;
            }
        
            $('#<%=lbQuery.ClientID %>').click(function() {
                setSearch();
                
                // 初始化分页参数为第一页
                $("#<%=GetStartHiddenFieldClientID()%>").val(1);
                
                // 手工提交表单
                $("form.first").submit();
            });
            
            $(".prePage,.nextPage,.Delete").click(function(){
                setSearch();
            })
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div style="width: 100%;">
        <table style="font-size: 8pt; width:693px;">
            <tr>
                <td class="style1">
                    专家姓名
                </td>
                <td>
                    <asp:TextBox runat="server" ID="txName" Width="200px"></asp:TextBox>
                </td>
                <td>
                    专家领域
                </td>
                <td>
                    <asp:DropDownList ID="ddlDomain" runat="server" Width="199px">
                    </asp:DropDownList>
                </td>
                <td>
                    &nbsp; |&nbsp;<asp:Button runat="server"  Text="新增" ID="lbNew" OnClick="lbNew_Click" />
                    &nbsp; |&nbsp;<asp:Button ID="lbQuery" runat="server" Text="查询"></asp:Button>
                </td>
            </tr>
            </table>
    </div>
    <input type="hidden" id="search" name="search"/>
    <uc1:PagingGridView ID="pgvExpertList" runat="server" />
</asp:Content>
